#include <iostream>
#include <string>
using namespace std;
class MyString: public string
{
    public:
     MyString();
     MyString(char * s);
     MyString operator * ( int n);
};
MyString::MyString():string()
{

}
MyString::MyString(char * s):string(s)
{

}
MyString MyString::operator * (int n)
{
    string st = *this;
    string result("");
    for(int i = 0; i<n; i++)
        result = result + st;
    MyString r((char *) result.c_str());
    return r;
}
int main()
{
    MyString s1("abc");
    cout<<s1<<endl;
    MyString s2;
    s2 = s1 * 3;
    cout<<s2<<endl;
}